<?php



class Model_Main {

protected $_dbTable;
protected $_row;

public function  __construct(Zend_Db_Table_Abstract $db) {

    $this->_dbTable = new $db;
    
   }




    public function __set($name,$val){

            if(isset($this->_row->$name)){

                $this->_row->$name=$val;
             }
   }


    public function _get($name){

           if(isset($this->_row->$name)){

               return  $this->_row->$name;

            }

    }

    public function save(){

        $this->_row->save();
    }


    public function fill($array){


            foreach ($array as $num => $val){

                if(isset($this->_row->$num)){
                    $this->_row->$num = $val;
                }
            }
    }

    public function populate(){

        return $this->_row->toArray();
}



    public function delete(){


        $this->_row->delete();



    }













    
}